<template>
	<view class="contents" :style="'height:'+screenHeight+'px;'">

		<!-- <view class="list">
			当前就诊人：<span style="color: black;"></span>
		</view> -->
		<view class="mzlist" v-for="(item,index) in list" :key="index" @click="detil(item.jsdjh)">
			<view class="mzhz">
				<view class="mza"><span>{{item.dptname}}&nbsp;</span>
					<span>总金额:&nbsp;<span>{{item.zje}}</span></span>
					<span>{{item.jssj}}</span>
				</view>
				<view><u-icon name="arrow-right"></u-icon></view>
			</view>
		</view>
		<view class="none" style="padding-top: 210rpx;" v-if="show">
			<view class="coent">
				<u-empty text="暂无信息" mode="list" icon-size="200">
				</u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: true,
				screenHeight: getApp().globalData.screenHeight-44,
				list: ''
			}
		},
		onLoad() {
			this.ZyMoney()
		},
		methods: {
			detil(e) {
				// console.log("单号", e)
				// let jzlsh = e.jzlsh
				uni.navigateTo({
					url: `/pages/zhuyaun/charge/chargedetilmz?jzlsh=${e}`
				})
			},
			zyfy(e) {
				if (e == 1) {
					this.zyfys = e
					this.ZyJfMoney()

				} else {
					this.zyfys = e
					this.ZyMoney()
				}
			},
			ZyMoney() {
				// uni.showLoading({
				// 	title: '请稍后',
				// 	mask: true
				// });
				this.$request("my", "Money").then(res => {
					console.log("住院收费", res)
					if (res.code == 1) {
						this.show = false
						this.list = res.data.resultdata
						uni.hideLoading();
					} else {
						this.show = true
						// uni.hideLoading();
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				}).catch(err => {
					uni.hideLoading();
					console.log("err", err)
					uni.showToast({
						title: err,
						icon: 'none',
						duration: 1000
					});
				});
			},
			ZyJfMoney() {
				// uni.showLoading({
				// 	title: '请稍后',
				// 	mask: true
				// });
				this.$request("my", "Money").then(res => {
					console.log("门诊收费", res)
					if (res.code == 1) {
						this.show = false
						this.list = res.data.resultdata
						// uni.hideLoading();

					} else {
						this.show = true
						// uni.hideLoading();
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				}).catch(err => {
					this.show = true
					uni.hideLoading();
					console.log("err", err)
					uni.showToast({
						title: err,
						icon: 'none',
						duration: 1000
					});

				});
			}
		}
	}
</script>

<style>
	@import './charge.css';
</style>